<script>
$(document).ready(function() {
	<?php
	if ($error == 'file_type') echo 'showNoti("Hỗ trợ .png .jpg .gif .swf", "Định dạng file không hợp lệ!", "Err");';
	if ($updated == 1) echo 'showNoti("Danh mục: '.$name.'", "Cập nhập danh mục thành công!", "Ok");';
	if ($failed == 1) echo 'showNoti("Danh mục: '.$name.'", "Cập nhập danh mục thất bại!", "Err");';
	?>	
});
</script>
<script src="js/tinymce/tinymce.min.js"></script>
<script src="js/tinymce.js"></script>
<?php 
echo form_open_multipart($action, array('id' => 'updateFrm'));
echo form_input(array('type' => 'hidden', 'name' => 'token', 'value' => $GLOBALS['var']['token']));
echo form_input(array('type' => 'hidden', 'name' => 'id', 'value' => $info['id']));
echo module_open();
?>
<tr class="no-border">
	<td>
        <input type="hidden" class="tabId" value="<?php echo $GLOBALS['var']['mytab'] ?>" />
        <ul id="myTab" class="nav nav-tabs">
            <li class="hide640<?php echo ($GLOBALS['var']['mytab'] == 0 ? ' active' : '') ?>" onclick="set_mytab($(this))"><a href="#tabs-0" data-toggle="tab">Thông tin</a></li>
            <li class="hide640<?php echo ($GLOBALS['var']['mytab'] == 1 ? ' active' : '') ?>" onclick="set_mytab($(this))"><a href="#tabs-1" data-toggle="tab">Giới thiệu</a></li>
            <li class="hide640<?php echo ($GLOBALS['var']['mytab'] == 2 ? ' active' : '') ?>" onclick="set_mytab($(this))"><a href="#tabs-2" data-toggle="tab">Ưu điểm</a></li>
            <li class="hide640<?php echo ($GLOBALS['var']['mytab'] == 3 ? ' active' : '') ?>" onclick="set_mytab($(this))"><a href="#tabs-3" data-toggle="tab">Vật liệu</a></li>
            <li class="dropdown active show640">
                <a class="dropdown-toggle" data-toggle="dropdown" href="#"><span class="current-tab-name">Thông tin</span> <span class="caret"></span></a>
                <ul class="dropdown-menu">
                    <li <?php echo ($GLOBALS['var']['mytab'] == 0 ? ' active' : '') ?>onclick="set_mytab($(this))"><a href="#tabs-0" data-toggle="tab">Thông tin</a></li>
		            <li <?php echo ($GLOBALS['var']['mytab'] == 1 ? ' active' : '') ?>onclick="set_mytab($(this))"><a href="#tabs-1" data-toggle="tab">Giới thiệu</a></li>
		            <li <?php echo ($GLOBALS['var']['mytab'] == 2 ? ' active' : '') ?>onclick="set_mytab($(this))"><a href="#tabs-2" data-toggle="tab">Ưu điểm</a></li>
		            <li <?php echo ($GLOBALS['var']['mytab'] == 3 ? ' active' : '') ?>onclick="set_mytab($(this))"><a href="#tabs-3" data-toggle="tab">Vật liệu</a></li>
                </ul>
            </li>
        </ul>
        <div id="myTabContent" class="tab-content">
	        <div id="tabs-0" class="tab-pane<?php echo ($GLOBALS['var']['mytab'] == 0 ? ' active' : '') ?>">
	        	<table cellpadding="0" cellspacing="0" width="100%" border="0">
					<tr>
						<td class="fr">
							<div class="tdleft clr320">Tên danh mục<?php if ($GLOBALS['cfg']['multi_lang']) { ?> tiếng Việt<?php } ?> <span style="color:red">*</span></div>
							<div class="tdright clr320">
						        <input type="text" data-required="1" class="medium" name="name_vn" id="name_vn" value="<?php echo $info['name_vn'] ?>" style="width:280px;" />
						        <div class="errordiv name_vn"><div class="arrow"></div>Vui lòng nhập tên danh mục!</div>
						    </div>
					    </td>
					</tr>
					<?php
					if ($GLOBALS['cfg']['multi_lang'])
					{
					?>
					<tr>
						<td class="fr">
							<div class="tdleft clr320">Tên danh mục tiếng Anh <span style="color:red">*</span></div>
							<div class="tdright clr320"><input type="text" class="medium" name="name_en" id="name_en" value="<?php echo $info['name_en'] ?>" style="width:280px;" /></div>
					    </td>
					</tr>
					<?php
					}
					?>
					<tr>
						<td class="fr">
							<div class="tdleft clr320">Danh mục mẹ</div>
							<div class="tdright clr320"><ul class="cat_treeview filetree treeview" style="height: 250px !important; width: 250px;"><?php echo cat_tree($categories, 0, $info['parent'], 'radio'); ?></ul></div>
						</td>
					</tr>
					<tr>
						<td class="fr">
							<div class="tdleft clr320">Hình ảnh</div>
							<div class="tdright clr320">
								<div class="image-wrap">
						            <input class="selectImage" type="file" name="userfile" />
						            <div class="image">
						                <div class="no-image" title="Click để chọn ảnh">
											<i class="icon36 glyphicons picture" style="<?php if(goodfile(CATS.'thumbs/'.$info['icon'])) { ?>display:none;<?php } ?>"></i>
						                    <img class="preview_img" style="<?php if(!goodfile(CATS.'thumbs/'.$info['icon'])) { ?>display:none;<?php } ?>" src="<?php echo CATS ?>thumbs/<?php echo $info['icon']?>" />
						                    <?php if ($info['icon']) echo del_image('icon', $info['id']); ?>
						                </div>
						            </div>
						            <div class="image-des">
						                <p>1. Định dạng ảnh cho phép: .gif, .jpg, .png</p>
						                <p>2. Kích thước lớn nhất: 1024px x 1024px</p>
						                <p>3. Dung lượng file lớn nhất: 1MB</p>
						                <div class="file-name">
						                    <div>
						                        <i class="icon glyphicons remove_2"></i> <p></p>
						                    </div>
						                </div>
						            </div>
						        </div>
						    </div>
						</td>
					</tr>
				</table>
			</div>
			<div id="tabs-1" class="tab-pane<?php echo ($GLOBALS['var']['mytab'] == 1 ? ' active' : '') ?>">
				<table cellpadding="0" cellspacing="0" width="100%" border="0">
					<tr>
					    <td class="fr">
					    	<div class="tdright clr320"><?php if ($GLOBALS['cfg']['multi_lang']) { ?>Giới thiệu tiếng VIệt<?php } ?></div>
					    	<div class="tdright clr320"><textarea class="mceEditor" name="des_vn" style="width:100%; height:100px; resize: none;"><?php echo $info['des_vn']?></textarea></div></td>
					</tr>
					<?php
					if ($GLOBALS['cfg']['multi_lang'])
					{
					?>
					<tr>
					    <td class="fr">
					    	<div class="tdleft clr320">Giới thiệu tiếng Anh</div>
					    	<div class="tdright clr320"><textarea class="mceEditor" name="des_en" style="width:100%; height:100px; resize: none;"><?php echo $info['des_en']?></textarea></div></td>
					</tr>
					<?php 
					} 
					?>
				</table>
			</div>
			<div id="tabs-2" class="tab-pane<?php echo ($GLOBALS['var']['mytab'] == 2 ? ' active' : '') ?>">
				<table cellpadding="0" cellspacing="0" width="100%" border="0">
					<tr>
					    <td class="fr">
					    	<div class="tdright clr320"><?php if ($GLOBALS['cfg']['multi_lang']) { ?>Ưu điểm tiếng VIệt<?php } ?></div>
					    	<div class="tdright clr320"><textarea class="mceEditor" name="uudiem_vn" style="width:100%; height:100px; resize: none;"><?php echo $info['uudiem_vn']?></textarea></div></td>
					</tr>
					<?php
					if ($GLOBALS['cfg']['multi_lang'])
					{
					?>
					<tr>
					    <td class="fr">
					    	<div class="tdleft clr320">Ưu điểm tiếng Anh</div>
					    	<div class="tdright clr320"><textarea class="mceEditor" name="uudiem_en" style="width:100%; height:100px; resize: none;"><?php echo $info['uudiem_en']?></textarea></div></td>
					</tr>
					<?php 
					} 
					?>
				</table>
			</div>
			<div id="tabs-3" class="tab-pane<?php echo ($GLOBALS['var']['mytab'] == 3 ? ' active' : '') ?>">
				<table cellpadding="0" cellspacing="0" width="100%" border="0">
					<tr>
					    <td class="fr">
					    	<div class="tdright clr320"><?php if ($GLOBALS['cfg']['multi_lang']) { ?>Vật liệu tiếng VIệt<?php } ?></div>
					    	<div class="tdright clr320"><textarea class="mceEditor" name="vatlieu_vn" style="width:100%; height:100px; resize: none;"><?php echo $info['vatlieu_vn']?></textarea></div>
					    </td>
					</tr>
					<?php
					if ($GLOBALS['cfg']['multi_lang'])
					{
					?>
					<tr>
					    <td class="fr">
					    	<div class="tdleft clr320">Vật liệu tiếng Anh</div>
					    	<div class="tdright clr320"><textarea class="mceEditor" name="vatlieu_en" style="width:100%; height:100px; resize: none;"><?php echo $info['vatlieu_en']?></textarea></div></td>
					</tr>
					<?php 
					} 
					?>
				</table>
			</div>
		</div>
	</td>
</tr>
<?php
echo module_close();
echo form_close();
?>